package app

import (
	"fmt"
	"net/http"
	//"runtime"
)

type exception struct {
}

var Exception exception

func (this *exception) Action(r *http.Request, path string) {

}

func (this *exception) Listen(r *http.Request, path string) {
	fmt.Println("监听异常")
	if err := recover(); err != nil {
		fmt.Println("捕获到了 panic 产生的异常: ", err)
		// msg := fmt.Sprintf("异常: %s", err)
		// return msg
		//res.Write([]byte(msg))
	}
	//return ""
}
